/*
* This file is part of WC2.
*
* WC2 is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* WC2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.

* You should have received a copy of the GNU General Public License
* along with WC2; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
*	Player.h - Player Class
*/

#ifndef PLAYER_H__
#define PLAYER_H__

#include "allegro.h"
#include <list>
#include <string>

class player
{
public:

	player(int pstr = 5, int pdex = 5, int pintel = 5, int pmorale = 0, int pexp = 20, int pmax_life = 20, int pcur_life = 20, int pmax_karma = 0, int pcur_karma = 0, int pmax_power = 0, int pcur_power = 0, int px = 0, int py = 0 )
	{
		str			= pstr;
		dex			= pdex;
		intel		= pintel;
		morale		= pmorale;
		exp			= pexp;
		max_life	= pmax_life;
		cur_life	= pcur_life;
		max_karma	= pmax_karma;
		cur_karma	= pcur_karma;
		max_power	= pmax_power;
		cur_power	= pcur_power;
		x			= px;
		y			= py;
	};

	virtual ~player() {}

	enum Profession {RANGER = 1, FIGHTER, PRIEST, THIEF, SORCERER};

	//Loc
	int x;
	int y;
	
	//Attributes
	int str;
	int dex;
	int intel;
	int morale;
	int exp;

	//Vitals
	int max_life;
	int cur_life;
	int max_karma;
	int cur_karma;
	int max_power;
	int cur_power;

	//Skills
	int close_combat;
	int sword;
	int axe;
	int spear;
	int mace;
	int flail;
	int bow;
	int crossbow;
	int shield;
	int combat_awareness;
	int scan;
	int swimming;
	int stealth;
	int hunt;
	int track;
	int first_aid;
	int search;
	int disarm_trap;
	int picklock;
	int haggle;
	int treat_poison;
	int treat_disease;
	int turn_undead;
	int alchemy;
	int luck;
	int read_ancient;
	int evaluate_magic;
	int cast_spell;

	//Cash
	int copper;
	int silver;
	int electrum;
	int gold;

	//State
	bool poisoned;
	bool alive;
	int n_injury;
	int n_bleed;
	int s_injury;
	int s_bleed;
	int professions[3];	//At creation can choose a max of up to 3 professions.

	int cur_map;

protected:
	//Name
	std::string player_name;

	//Icon
	BITMAP *icon;
	std::list <player *> player_InventoryList;

	
};

class party : public player
{
	party();
	virtual ~party() {}
protected:
	std::list <player *> plyr_Partylist;
};

class monster : public player
{
	monster();
	monster(int istr, int idex, int iintel, int icopper, int isilver, int ilife, int ipower, int iimmune = 0, bool IsUndead = FALSE)
	{
		istr 		= str;
		idex 		= dex;
		iintel 		= intel;
		icopper 	= copper;
		isilver 	= silver;
		ilife   	= max_life;
		ipower  	= max_power;
	}
	~monster();

	void SetIsUndead()
	{
		IsUndead = TRUE;
	}

	int generate_copper(int max)
	{
		int imax = rand() % max + 1;
		return imax;
	}

	int generate_silver(int max)
	{
		int imax = rand() % max + 1;
		return imax;
	}
		
protected:
	int immuneto;
	bool IsUndead;
	int str;
	int dex;
	int intel;
	int max_life;
	int max_power;
	int cur_life;
	int cur_power;

	std::list <monster *> Mob_InventoryList;
};

#endif
	